In this set of exercises, we will 1) make sure that you can use Git from within RStudio and 2) clone and work on the GitHub repository you have created in the previous session.
Note: You can find the solutions for this exercise as well as the following ones in the solutions folder within the workshop materials.
Git.
R and RStudio.
R package.
R/RStudio.
gitcreds package (which should be installed together with usethis) provides a function for this.
Git via RStudio and have created and stored a PAT for authentication via HTTPS, we can now clone and work on the GitHub repository we have created in the previous session. When doing this, you should also create a new RStudio project.
Git tab. To make extra sure that everything worked, let’s check the Git status of our project via the Terminal in RStudio.
Terminal in RStudio uses via Tools -> Global Options -> Terminal. If you use Windows, you should choose Git Bash (which you should have installed with Git for Windows).
Now that the project is set up and in sync with the remote GitHub repository, we can start working on it. Modify the README file (just add, remove or edit a few words). If you want to, you can also create a new folder called data and copy the file ZA5667_v1-0-0_CSV_synthetic-data.csv from the workshop materials there (either via the CLI/Terminal or by copying and pasting in your file explorer). This second step is optional. We will be using this in the following sessions, but you can also copy it then.
Git.
Git tab in RStudio and their status will be indicated as modified or untracked.